Explanation:

Your main class must include the following in its declaration:

extends Script

This allows the program to use most of the Sony script functionality, such as grabbing fields, manipulating eventOuts, etc.